package com.atguigu.gulimall.cart.service;

import com.atguigu.gulimall.cart.vo.Cart;
import com.atguigu.gulimall.cart.vo.CartItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @version 1.0
 * @Author yanjingren
 * @Date 2021/6/28
 * @Description com.atguigu.gulimall.cart.service
 */
public interface CartService {
    // 添加商品到购物车
    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;
    // 获取购物车中购物项
    CartItem getCartItem(Long skuId);
    // 获取整个购物车
    Cart getCart() throws ExecutionException, InterruptedException;
    // 清空购物车的数据
    void clearCart(String cartKey);
    // 勾选购物项
    void checkItem(Long skuId, Integer check);
    // 更新商品数量
    void countItem(Long skuId, Integer num);
    // 删除购物车中商品
    void deleteItem(Long skuId);

    List<CartItem> getUserCartItems();
}
